package written_test;

import java.util.Collections;
import java.util.Scanner;
import java.util.Stack;

/**
 * @author zhx
 * @since 2020-09-12
 */
public class Migu {

    public static void main(String[] args) {
        Stack<Integer> arr = new Stack<>();
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            arr.push(in.nextInt());
        }
        Collections.sort(arr);
        int result = 0;
        while (!arr.isEmpty()) {
            int tmp1 = arr.pop();
            int tmp2 = arr.pop();
            if (tmp1 == tmp2) {
            } else {
                if (arr.peek() == tmp1) {
                    result = tmp2;
                    break;
                } else {
                    result = tmp1;
                    break;
                }
            }

        }

        System.out.println(result);

    }
}
